# This is a sample Python script.

# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.

import matplotlib.pyplot as plt
import pandas as pd
import bar_chart_race as bcr

def print_hi(name):
    # Use a breakpoint in the code line below to debug your script.
    print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.

    plt.rcParams["font.sans-serif"] = ["SimHei"]  # 设置字体
    # plt.rcParams["axes.unicode_minus"] = False

    df = pd.read_csv('./dateBar.csv',index_col=0,encoding='gbk')  # 导入数据
    print(df)
    bcr.bar_chart_race(df,filename='example.gif',writer='pillow',fixed_max=True,bar_label_size=15,tick_label_size=10)
    bcr.bar_chart_race(df,filename='example.html',fixed_max=True,bar_label_size=15,tick_label_size=10)




# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print_hi('PyCharm')
